/*
 * @Descripttion:
 * @version:
 * @Author: congsir
 * @Date: 2025-10-27 23:31:05
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2025-11-02 22:06:52
 */
import { PayloadAction, createSlice } from '@reduxjs/toolkit'
interface initialStateType {
  count: number
  message: string
  direction: 'left' | 'right' | 'up' | 'down'
}
const initialState: initialStateType = {
  count: 100,
  message: 'Hello',
  direction: 'left'
}
const counterSlice = createSlice({
  name: 'counter',
  initialState,
  reducers: {
    changeMessageAction(state, { payload }: PayloadAction<string>) {
      state.message = payload
    }
  }
})
export const { changeMessageAction } = counterSlice.actions
export default counterSlice.reducer
